package constrctor.service.impl;

import constrctor.entity.RiskAssessor;
import constrctor.service.DatabaseAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DatabaseAccountServiceImpl implements DatabaseAccountService {

    // 这里要将对象使用final声明，保证注入之后不会被修改
    private final RiskAssessor riskAssessor;

    // 如果有一个构造器，你可以省略@Autowired
    @Autowired
    public DatabaseAccountServiceImpl ( RiskAssessor riskAssessor ) {
        this.riskAssessor = riskAssessor;
    }

    public void print ( ) {
        System.out.println(riskAssessor.getName());
    }
}
